import { Component, OnInit } from '@angular/core';
import { getISOWeek } from 'date-fns';
interface Person {
  title: string;
  type: string;
  site: string;
  updatedAt: string;
  addAt: string;
}
@Component({
  selector: 'app-report',
  templateUrl: './report.component.html',
  styleUrls: ['./report.component.scss']
})
export class ReportComponent implements OnInit {

  listOfData: Person[] = [
    {
      title: 'John Brown',
      type: '正面舆情',
      site: '新华社',
      updatedAt:'2012-12-34',
      addAt:'2022-3-12',
    },
    {
      title: 'John Brown',
      type: '正面舆情',
      site: '新华社',
      updatedAt:'2012-12-34',
      addAt:'2022-3-12',
    },
    {
      title: 'John Brown',
      type: '正面舆情',
      site: '新华社',
      updatedAt:'2012-12-34',
      addAt:'2022-3-12',
    },
    {
      title: 'John Brown',
      type: '正面舆情',
      site: '新华社',
      updatedAt:'2012-12-34',
      addAt:'2022-3-12',
    },
    {
      title: 'John Brown',
      type: '正面舆情',
      site: '新华社',
      updatedAt:'2012-12-34',
      addAt:'2022-3-12',
    },
  ];
  start_date = null;
  end_date = null;
  onChange(result: Date[]): void {
    console.log('onChange: ', result);
  }

  getWeek(result: Date[]): void {
    console.log('week: ', result.map(getISOWeek));
  }
  constructor() { }

  ngOnInit(): void {
  }

}
